<div class="layui-fluid nepadmin-pad0 nepadmin-mar0 list0" id="list" lay-title="财务明细">
	<div class="layui-fluid">
		<div class="layui-row layui-col-space15">
			<div class="layui-col-md12">
				<div class="layui-card hxr-layui-card" id="userlistv">
					<div class="layui-form layui-card-header hxradmin-card-header">
						<div class="layui-form-item">
							<div class="layui-inline">
								<label class="layui-form-label">提款日期范围</label>
								<div class="layui-input-inline" style="width: 300px;">
									<input type="text" name="user" id='date' placeholder="请选择日期范围" class="layui-input" readonly>
								</div>
							</div>
							<div class="layui-inline">
								<label class="layui-form-label">状态</label>
								<div class="layui-input-inline">
									<div class="layui-unselect layui-form-select">
										<div class="layui-select-title"><input name="status" type="text" placeholder="请选择状态" value="" readonly class="layui-input layui-unselect"><i
											 class="layui-edge"></i></div>
										<dl class="layui-anim layui-anim-upbit" style="">
											<dd lay-value="" class="layui-select-tips layui-this">请选择</dd>
											<dd data='0'>提成</dd>
											<dd data='1'>提现</dd>
											<dd data='2'>提现失败返还</dd>
										</dl>
									</div>
								</div>
							</div>
							<div class="layui-inline">
								<button class="layui-btn" data-type="reload" id="drawingssearch">搜索</button>
							</div>
						</div>
					</div>
					<div class="layui-card-body">
						<table class="layui-hide" id="list-table" lay-filter="list-table"></table>
					</div>
				</div>
				<!-- <script type="text/html" id="status">
				  {{#  if(d.status === 0){ }}
				    <span style="color: red;">申请中</span>
				  {{#  } else if(d.status === 1) { }}
				    <span style="color: #00d57b;">同意</span>
					{{#  } else if(d.status === 2) { }}
					  <span style="color: #ff5722;">拒绝</span>
				  {{#  } }}
				</script> -->
			</div>
		</div>
	</div>
</div>
<style type="text/css">
	.layui-laydate-content td.laydate-selected{
		background: #dbe3f5;
	}
	.layui-laydate td.layui-this{
		background: #a4bfff !important;
	}
</style>
<script>
	var userlist=new Vue({
		el:'#userlistv',
		data:{
			d:0,
			role:[{
				role_id:1,
				role_name:"角色1"
			},{
				role_id:2,
				role_name:"角色2"
			}]
		},
		created() {
			/* layui.admin.ajax('role/list',{},1).then((res)=>{
				this.role=res.data.list;
			}).catch((res)=>{}); */
		}
	});
	var formurl='drawings/drawingsform',formarea=['500px', '570px'];
	//表格数据渲染
	
	layui.use(['table', 'form','laydate'], function() {
		var table = layui.table,
			form = layui.form,
			$ = layui.$,laydate=layui.laydate;
			//日期范围
			  laydate.render({
			    elem: '#date'
			    ,range: true
			  });
			layui.admin.initlist(table,'drawings/request_list',275,[
						[{
							field: 'agent_name',
							title: '提现流水号',
							width: 100
						}, {
							field: 'bank_name',
							title: '用户名',
							width: 200
						}, {
							field: 'bank_name',
							title: '变动前金额',
							width: 200
						}, {	
							field: 'bank_account',
							title: '变动金额',
							minWidth: 200
						}, {
							field: 'withdraw_amount',
							title: '变动后金额',
							minWidth: 200
						}, {
							field: 'should_amount',
							title: '变动时间',
							minWidth: 200
						}, {
							field: 'withdraw_fee',
							title: '变动设备',
							minWidth: 200
						}]
					])
		
		//监听行双击事件
		table.on('rowDouble(list-table)', function(obj) {
			//查看详情
			layui.admin.pupF('用户详情', formarea, formurl, 3, obj.data);
		});
		var active = {
			set: function() {
					layui.admin.pupF('提款设置',formarea,formurl, 2);
				}
		};
		//操作dom
		$('.layui-btn.layuiadmin-btn-list').on('click', function() {
			var type = $(this).data('type');
			active[type] ? active[type].call(this) : '';
		});
		//搜索
		$('#drawingssearch').on('click', function() {
			var obj=$(this).parents('.layui-form-item');
			var val1 = obj.find('input[name="user"]'),
				val2 = obj.find('input[name="role"]'),
				val3 = obj.find('input[name="status"]');
			//执行重载

			table.reload('list-table', {
				page: {
					curr: 1 //重新从第 1 页开始
				},
				where: {
					search_text: val1.val(),
					role_id: val2.attr('data'),
					admin_status: val3.attr('data')
				}
			});
		});
	});
</script>
